<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/result.css"/>
		<script src="vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<div class="num">
				<button @click="minus()">-</button>
				<div class="a">
					<span>{{num}}</span>
				</div>
				<button @click="add()">+</button>
			</div>
		</div>
		<script>
			var app = new Vue({
				el:"#app",
				data:{
					num:1
				},
				methods:{
					add:function(){
						if(this.num<10){
							this.num++
						}else{
							alert("最大了哦！")
						}
					},
					minus:function(){
						if(this.num>0){
							this.num--
						}else{
							alert("最小了哦1！")
						}
					}
				}
			})
		</script>
	</body>
</html>
